function IsNumeric(sText)
{
   var ValidChars = "-0123456789.";
   var IsNumber=true;
   var Char;
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
}

function isDate(DateToCheck){
    if(DateToCheck==""){return true;}
    var m_strDate = DateToCheck;
    if(m_strDate==""){
        return false;
    }
    var m_arrDate = m_strDate.split("/");
    var m_DAY = m_arrDate[1];
    var m_MONTH = m_arrDate[0];
    var m_YEAR = m_arrDate[2];
    if(m_DAY == null){return false;}
    if(m_MONTH == null){return false;}
    if(m_YEAR == null){return false;}
    if(m_YEAR.length > 4){return false;}
    if(m_YEAR.length < 4){return false;}
    m_strDate = m_MONTH + "/" + m_DAY + "/" + m_YEAR;
    var testDate=new Date(m_strDate);
    if(testDate.getMonth()+1==m_MONTH){
        return true;
    }
    else{
        return false;
    }
}//end function

function formatTextToCurrency(num) {
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num))
	num = "0";
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	if(cents<10)
	cents = "0" + cents;
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
	num = num.substring(0,num.length-(4*i+3))+','+
	num.substring(num.length-(4*i+3));
	return (((sign)?'':'-') + num + '.' + cents);
}

function formatLabel(label){
	if(label){
		return label.replace(':', ' ');
	}
	return label;
}
function alertCalendarUsage(element){

}
function isPhoneNumber(sText){
	if (sText == ''){
		return true;
	}
	if (sText.length > 16){
		return false;
	}
   var ValidChars = "-0123456789() ";
   var IsPhone = true;
   var Char;
   for (i = 0; i < sText.length && IsPhone == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsPhone = false;
         }
      }
   return IsPhone;
}